using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._ConversionTools._FromRaster
{
    /// <summary>
    /// <para>Raster to Polygon</para>
    /// <para>Converts a raster dataset to polygon features.</para>
    /// <para>将栅格数据集转换为面要素。</para>
    /// </summary>    
    [DisplayName("Raster to Polygon")]
    public class RasterToPolygon : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public RasterToPolygon()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster dataset.</para>
        ///   <para>The raster must be integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格数据集。</para>
        ///   <para>栅格必须为整数类型。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_polygon_features">
        /// <para>Output polygon features</para>
        /// <para>The output feature class that will contain the converted polygons.</para>
        /// <para>将包含转换后的面的输出要素类。</para>
        /// </param>
        public RasterToPolygon(object _in_raster, object _out_polygon_features)
        {
            this._in_raster = _in_raster;
            this._out_polygon_features = _out_polygon_features;
        }
        public override string ToolboxName => "Conversion Tools";

        public override string ToolName => "Raster to Polygon";

        public override string CallName => "conversion.RasterToPolygon";

        public override List<string> AcceptEnvironments => ["MDomain", "MResolution", "MTolerance", "XYDomain", "XYResolution", "XYTolerance", "ZDomain", "ZResolution", "ZTolerance", "autoCommit", "configKeyword", "extent", "geographicTransformations", "maintainSpatialIndex", "outputCoordinateSystem", "outputMFlag", "outputZFlag", "outputZValue", "scratchWorkspace", "snapRaster", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_polygon_features, _simplify.GetGPValue(), _raster_field, _create_multipart_features.GetGPValue(), _max_vertices_per_feature];

        /// <summary>
        /// <para>Input raster</para>
        /// <para><xdoc>
        ///   <para>The input raster dataset.</para>
        ///   <para>The raster must be integer type.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入栅格数据集。</para>
        ///   <para>栅格必须为整数类型。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output polygon features</para>
        /// <para>The output feature class that will contain the converted polygons.</para>
        /// <para>将包含转换后的面的输出要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output polygon features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_polygon_features { get; set; }


        /// <summary>
        /// <para>Simplify polygons</para>
        /// <para><xdoc>
        ///   <para>Determines if the output polygons will be smoothed into simpler shapes or conform to the input raster's cell edges.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—The polygons will be smoothed into simpler shapes. The smoothing is done in such a way that the polygons contain a minimum number of segments while remaining as close as possible to the original raster cell edges. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—The edge of the polygons will conform exactly to the input raster's cell edges. With this option, converting the resulting polygon feature class back to a raster would produce a raster the same as the original.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>确定输出面是平滑为更简单的形状还是符合输入栅格的像元边缘。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 面将被平滑为更简单的形状。平滑处理的方法是，面包含最少数量的线段，同时尽可能接近原始栅格像元边缘。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 面的边缘将与输入栅格的像元边缘完全一致。使用此选项时，将生成的面要素类转换回栅格将生成与原始栅格相同的栅格。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Simplify polygons")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _simplify_value _simplify { get; set; } = _simplify_value._true;

        public enum _simplify_value
        {
            /// <summary>
            /// <para>SIMPLIFY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SIMPLIFY")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_SIMPLIFY</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_SIMPLIFY")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Field</para>
        /// <para><xdoc>
        ///   <para>The field used to assign values from the cells in the input raster to the polygons in the output dataset.</para>
        ///   <para>It can be an integer or a string field.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于将输入栅格中像元中的值分配给输出数据集中的面的字段。</para>
        ///   <para>它可以是整数或字符串字段。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _raster_field { get; set; } = null;


        /// <summary>
        /// <para>Create multipart features</para>
        /// <para><xdoc>
        ///   <para>Specifies whether the output polygons will consist of single-part or multipart features.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Specifies that multipart features will be created based on polygons that have the same value.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Specifies that individual features will be created for each polygon. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定输出面是由单部分要素还是多部分要素组成。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 指定将基于具有相同值的面创建多部分要素。</bullet_item><para/>
        ///     <bullet_item>未选中 - 指定将为每个面创建单个要素。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Create multipart features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _create_multipart_features_value _create_multipart_features { get; set; } = _create_multipart_features_value._false;

        public enum _create_multipart_features_value
        {
            /// <summary>
            /// <para>SINGLE_OUTER_PART</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("SINGLE_OUTER_PART")]
            [GPEnumValue("false")]
            _false,

            /// <summary>
            /// <para>MULTIPLE_OUTER_PART</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("MULTIPLE_OUTER_PART")]
            [GPEnumValue("true")]
            _true,

        }

        /// <summary>
        /// <para>Maximum vertices per polygon feature</para>
        /// <para><xdoc>
        ///   <para>The vertex limit used to subdivide a polygon into smaller polygons. This parameter produces similar output as created by the Dice tool.</para>
        ///   <para>If left empty, the output polygons will not be split. The default is empty.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于将多边形细分为更小多边形的顶点限制。此参数生成的输出与骰子工具创建的输出类似。</para>
        ///   <para>如果留空，则不会拆分输出多边形。默认值为空。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Maximum vertices per polygon feature")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _max_vertices_per_feature { get; set; } = null;


        public RasterToPolygon SetEnv(object MDomain = null, object MResolution = null, object MTolerance = null, object XYDomain = null, object XYResolution = null, object XYTolerance = null, object ZDomain = null, object ZResolution = null, object ZTolerance = null, int? autoCommit = null, object configKeyword = null, object extent = null, object geographicTransformations = null, bool? maintainSpatialIndex = null, object outputCoordinateSystem = null, object outputMFlag = null, object outputZFlag = null, object outputZValue = null, object scratchWorkspace = null, object snapRaster = null, object workspace = null)
        {
            base.SetEnv(MDomain: MDomain, MResolution: MResolution, MTolerance: MTolerance, XYDomain: XYDomain, XYResolution: XYResolution, XYTolerance: XYTolerance, ZDomain: ZDomain, ZResolution: ZResolution, ZTolerance: ZTolerance, autoCommit: autoCommit, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, maintainSpatialIndex: maintainSpatialIndex, outputCoordinateSystem: outputCoordinateSystem, outputMFlag: outputMFlag, outputZFlag: outputZFlag, outputZValue: outputZValue, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, workspace: workspace);
            return this;
        }

    }

}